/*
 SGRecyclableType.m
 Date Created: March 6, 2010
 
 Authors: Karanvir Gill <viper1029@gmail.com>
          Frank Lau <flaua@sfu.ca>
 
 Copyright (C) 2010 Green-Power
 
 URL: http://code.google.com/p/green-power
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 3 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
 $Id$
 */

#import "SGRecyclableType.h"


@implementation SGRecyclableType

@synthesize uniqueName;
@synthesize name;
@synthesize image;
@synthesize depositValue;
@synthesize description;

- (BOOL)isEqual:(id)anObject {
  if([anObject isKindOfClass:[SGRecyclableType class]]) {
    SGRecyclableType *anType=(SGRecyclableType *)anObject;
    return [anType.uniqueName isEqualToString:self.uniqueName];
  } else {
    return [super isEqual:anObject];
  }
}

// Used for testing for uniqness
- (NSUInteger)hash {
  return uniqueName.hash;
}

+ (NSArray *)listOfficialTypes {
	SGRecyclableType *cans=[[SGRecyclableType alloc] init];
	cans.uniqueName=@"cans";
	cans.image = [[NSArray alloc] initWithObjects:@"SGcans.png",@"SGcans2.png",@"SGcans3.png",nil];
	cans.name=@"Cans";
  cans.description=@"This is an alumninum can, its shaped like a cylinder with a tab to open it easily. Remember to leave the tabs on, recycling depots can recycle them too!";
	cans.depositValue=5;
	
	SGRecyclableType *clearPlasticSmall=[[SGRecyclableType alloc] init];
	clearPlasticSmall.uniqueName=@"clearPlasticSmall";
	clearPlasticSmall.image=[[NSArray alloc] initWithObjects:@"SGclearPlasticSmall.png",@"SGclearPlasticSmall2.png",@"SGclearPlasticSmall3.png",nil];
	clearPlasticSmall.name=@"Clear Plastic (Small)";
  clearPlasticSmall.description=@"This is a clear plastic bottle. Made with see-through plastic. It can contain variety of liquids. Caps can be recycled, and some depots take the caps too. A small bottle is under 1 liter in volume.";
	clearPlasticSmall.depositValue=5;
	
	SGRecyclableType *clearPlasticLarge=[[SGRecyclableType alloc] init];
	clearPlasticLarge.uniqueName=@"clearPlasticLarge";
	clearPlasticLarge.image=[[NSArray alloc] initWithObjects:@"SGclearPlasticLarge.png",@"SGclearPlasticLarge2.png",@"SGclearPlasticLarge3.png",nil];
	clearPlasticLarge.name=@"Clear Plastic (Large)";
  clearPlasticLarge.description=@"This is a clear plastic bottle. Made with see-through plastic. It can contain variety of liquids. Caps can be recycled, and some depots take the caps too. A small bottle is any bottle over 1 liter in volume.";
	clearPlasticLarge.depositValue=20;
	
	SGRecyclableType *pouches=[[SGRecyclableType alloc] init];
	pouches.uniqueName=@"pouches";
	pouches.image=[[NSArray alloc] initWithObjects:@"SGpouches.png",nil];
	pouches.name=@"Pouches";
  pouches.description=@"Small neat and always a treat. The pouch was designed to be flat when stored, and plump when full. Currently, apple juices and Kool-aid are the most common users of this drink containment system.";
	pouches.depositValue=5;
	
	SGRecyclableType *tetraPakSmall=[[SGRecyclableType alloc] init];
	tetraPakSmall.uniqueName=@"tetraPakSmall";
	tetraPakSmall.image=[[NSArray alloc] initWithObjects:@"SGtetraPakSmall.png",nil];
	tetraPakSmall.name=@"Tetra Pak (Small)";
  tetraPakSmall.description=@"These are tetra paks, they are rectangular prism shaped.";
	tetraPakSmall.depositValue=5;
	
	SGRecyclableType *tetraPakLarge=[[SGRecyclableType alloc] init];
	tetraPakLarge.uniqueName=@"tetraPakLarge";
	tetraPakLarge.image=[[NSArray alloc] initWithObjects:@"SGtetraPakLarge.png",nil];
	tetraPakLarge.name=@"Tetra Pak (Large)";
  tetraPakLarge.description=@"These are tetra paks, they are rectangular prism shaped. Large (greater than a litre) tetra paks are rare, but they are worth 20 cents if you find one.";
	tetraPakLarge.depositValue=20;
	
	SGRecyclableType *otherPlasticSmall=[[SGRecyclableType alloc] init];
	otherPlasticSmall.uniqueName=@"otherPlasticSmall";
	otherPlasticSmall.image=[[NSArray alloc] initWithObjects:@"SGotherPlasticSmall.png",nil];
	otherPlasticSmall.name=@"Other Plastic (Small)";
  otherPlasticSmall.description=@"These are also made with plastic, but with other plastic that are not see-through. These cover a wider range of drinks, and remember bigger size equals more money.";
	otherPlasticSmall.depositValue=5;
	
	SGRecyclableType *otherPlasticLarge=[[SGRecyclableType alloc] init];
	otherPlasticLarge.uniqueName=@"otherPlasticLarge";
	otherPlasticLarge.image=[[NSArray alloc] initWithObjects:@"SGotherPlasticLarge.png",nil];
	otherPlasticLarge.name=@"Other Plastic (Large)";
  otherPlasticLarge.description=@"These are also made with plastic, but with other plastic that are not see-through. These cover a wider range of drinks, and remember bigger size equals more money.";
	otherPlasticLarge.depositValue=20;
	
	SGRecyclableType *garbage = [[SGRecyclableType alloc] init];
	garbage.uniqueName = @"garbage";
	garbage.image = [[NSArray alloc] initWithObjects:@"SGfish.png",@"SGbananaPeel.png",@"SGbananaPeel2.png",@"SGoldBoot.png",nil];
	garbage.name = @"Garbage";
  garbage.description=@"Not everything is recyclable, like garbage. If you see any garbage, just let it go into the garbage can.";
	garbage.depositValue = 0; 
	
	SGRecyclableType *gableSmall=[[SGRecyclableType alloc] init];
	gableSmall.uniqueName=@"gableSmall";
	gableSmall.image=[[NSArray alloc] initWithObjects:@"SGgableSmall.png",nil];
	gableSmall.name=@"Gable (Small)";
  gableSmall.description=@"These are called gable tops; tops shaped like roofs of a gable house. They come in a variety of sizes, but all will have the same top.";
	gableSmall.depositValue=5;
	
	SGRecyclableType *gableLarge=[[SGRecyclableType alloc] init];
	gableLarge.uniqueName=@"gableLarge";
	gableLarge.image=[[NSArray alloc] initWithObjects:@"SGgableLarge.png",nil];
	gableLarge.name=@"Gable (Large)";
  gableLarge.description=@"These are called gable tops; tops shaped like roofs of a gable house. They come in a variety of sizes, but all will have the same top.";
	gableLarge.depositValue=20;
	
	SGRecyclableType *glassSmall=[[SGRecyclableType alloc] init];
	glassSmall.uniqueName=@"glassSmall";
	glassSmall.image=[[NSArray alloc] initWithObjects:@"SGglassSmall.png",nil];
	glassSmall.name=@"Glass (Small)";
  glassSmall.description=@"Careful! Those are glass bottles. Made from the same material as windows, once broken they are DANGEROUS and worthless.";
	glassSmall.depositValue=5;
	
	SGRecyclableType *glassLarge=[[SGRecyclableType alloc] init];
	glassLarge.uniqueName=@"glassLarge";
	glassLarge.image=[[NSArray alloc] initWithObjects:@"SGglassLarge.png",nil];
	glassLarge.name=@"Glass (Large)";
  glassLarge.description=@"Careful! Those are glass bottles. Made from the same material as windows, once broken they are DANGEROUS and worthless.";
	glassLarge.depositValue=20;
	
	
	NSArray *list=[[NSArray alloc] initWithObjects:cans,
								 clearPlasticSmall,clearPlasticLarge,
								 pouches,
								 tetraPakSmall,tetraPakLarge,
								 otherPlasticSmall,otherPlasticLarge,
								 gableSmall,gableLarge,
								 glassSmall,glassLarge,
								 garbage,
								 nil];
	return list;
}

@end
